/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.worsik.vypocty.topeni.tepelneztraty.model;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author 231260
 */
public class Mistnost extends Obecny {
	
	private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport( this );
	
	String nazev;
	String ucel;
	int teplota_vnitrni;
	int podlazi;
	Double prirazka_p3;
	Double plocha_sten;
	Double tepelna_ztrata;
	Objekt objekt;
	SvetovaStrana svetova_strana;
	
	private List<Stena> stenyList;
	
	public Mistnost(Objekt objekt)
	{
		this.objekt = objekt;
		this.teplota_vnitrni = 20;
		this.nazev = "101";
		this.ucel = "pokoj";
		this.tepelna_ztrata = 0d;
		this.plocha_sten = 0d;
		this.prirazka_p3 = 0d;
		
		stenyList = new ArrayList<Stena>();
	}

	public List<Stena> getStenyList() {
		return stenyList;
	}
	
	public void addPropertyChangeListener( PropertyChangeListener listener ) {
		propertyChangeSupport.addPropertyChangeListener( listener );
    }

	public String getNazev() {
		return nazev;
	}

	public void setNazev(String nazev) {
		this.nazev = nazev;
	}

	public Objekt getObjekt() {
		return objekt;
	}

	public void setObjekt(Objekt objekt) {
		this.objekt = objekt;
	}

	public Double getPlocha_sten() {
		return plocha_sten;
	}

	public void setPlocha_sten(Double plocha_sten) {
		this.plocha_sten = plocha_sten;
	}

	public int getPodlazi() {
		return podlazi;
	}

	public void setPodlazi(int podlazi) {
		this.podlazi = podlazi;
	}

	public Double getPrirazka_p3() {
		return prirazka_p3;
	}

	public void setPrirazka_p3(Double prirazka_p3) {
		this.prirazka_p3 = prirazka_p3;
	}

	public SvetovaStrana getSvetova_strana() {
		return svetova_strana;
	}

	public void setSvetova_strana(SvetovaStrana svetova_strana) {
		this.svetova_strana = svetova_strana;
	}

	public Double getTepelna_ztrata() {
		return tepelna_ztrata;
	}

	public void setTepelna_ztrata(Double tepelna_ztrata) {
		Double old = this.tepelna_ztrata;
		
		this.tepelna_ztrata = tepelna_ztrata;
		
		propertyChangeSupport.firePropertyChange( "tepelnaZtrata", old, tepelna_ztrata );
	}

	public int getTeplota_vnitrni() {
		return teplota_vnitrni;
	}

	public void setTeplota_vnitrni(int teplota_vnitrni) {
		this.teplota_vnitrni = teplota_vnitrni;
	}

	public String getUcel() {
		return ucel;
	}

	public void setUcel(String ucel) {
		this.ucel = ucel;
	}
	
	public String getNazevTabu()
	{
		return nazev+" - "+ucel;
	}
}
